<?php
/**

 * @version $Id: view.html.php,v 1.4 2009/06/04 20:13:37 dgravato Exp $

 * @package    sketchup

 * @subpackage 

 * @author     Chris Borkowski {@link http://www.guggenheim.org}

 * @author     Created on 04-April-2009

 */

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

/**
 * HTML View class for the sketchup Component
 *
 * @package    sketchup
 */

class ViewVote extends JView
{

	function display($tpl = null)
	{
		global $option;
		
		$list = $this->get('List');

		for($i = 0; $i < count($list); $i++) 
		{ 
			$row =& $list[$i]; 
			$row->link = JRoute::_('index.php?option=' . $option . '&id=' . $row->id  . '&view=project'); 
		}
		
    $pagination =& $this->get('Pagination');

    if ($list->finalist == 1) {
      $finalist = 'FINALIST';
    }	else	{
      $finalist = '';
    }

    //set page title
    $document = & JFactory::getDocument();
    $document->setTitle('Vote for People\'s Prize');

    // make docmement metadata out of db elements 
    $keywords = JText::_('Googel, Guggenehim, Design It Contest, Digital Art, Architecture');
    $document->setMetaData ('keywords', $keywords);

    //might not use it
    $uri =& JFactory::getURI();
    $this->requestURL =& $uri->toString();

    $already_voted = JRequest::getInt('already_voted', 0);

    // push data into the template
    $this->assignRef('finalist', $finalist);
    $this->assignRef('pagination', $pagination);
    $this->assignRef('list', $list); 
    $this->assign('already_voted', $already_voted); 

    parent::display($tpl);	
	}

} 

?>